%% copy riak-0.14.2 source to learn dynamo implementation and erlang
%% author: lichuang
%% copy source from riak_core_vnode_sup.erl

-module(edynamo_vnode_sup).
-behaviour(supervisor).
-export([start_link/0, init/1]).
-export([start_vnode/2]).

start_vnode(Mod, Index) when is_integer(Index) -> 
  supervisor:start_child(?MODULE, [Mod, Index]).

start_link() ->
  supervisor:start_link({local, ?MODULE}, ?MODULE, []).

%% @private
init([]) ->
  {ok, {{simple_one_for_one, 10, 10},
      [{undefined, {edynamo_vnode, start_link, []},
	  temporary, brutal_kill, worker, dynamic}]}}.
